/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.insta.browser.view.tab;

import fr.insta.browser.service.history.IHistoryService;
import fr.insta.browser.service.tab.ITabService;
import fr.insta.browser.view.webview.WebViewFactory;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import org.sexydock.tabs.Tab;

/**
 * <p>TabFactory class.</p>
 *
 * @author Maarek
 * @version $Id: $Id
 */
public class TabFactory implements ITabFactory {

    final private WebViewFactory webViewFactory;
    final private ITabService tabService;
    final private IHistoryService historyService;

    private JFrame frame;
    private JTabbedPane tabbedPane;

    /**
     * <p>Constructor for TabFactory.</p>
     *
     * @param webViewFactory a {@link fr.insta.browser.view.webview.WebViewFactory} object.
     * @param tabService a {@link fr.insta.browser.service.tab.ITabService} object.
     * @param historyService a {@link fr.insta.browser.service.history.IHistoryService} object.
     */
    public TabFactory(WebViewFactory webViewFactory, ITabService tabService, IHistoryService historyService) {
        this.webViewFactory = webViewFactory;
        this.tabService = tabService;
        this.historyService = historyService;
    }

    /** {@inheritDoc} */
    @Override
    public void setTabbedPane(JTabbedPane tabbedPane) {
        this.tabbedPane = tabbedPane;
    }

    /** {@inheritDoc} */
    @Override
    public Tab createTab() {
        return new Tab();
    }

    /** {@inheritDoc} */
    @Override
    public Tab createTabWithContent() {
        ContentTab contentTab = new ContentTab(historyService, tabService, tabbedPane, webViewFactory);
        return new Tab("Nouvel Onglet", contentTab);
    }
}
